//################################
// 版权所有：中国农业银行软件开发中心
// 系统名称：移动办公应用-手机版
// 文件名称：firstPageGameDetail.js
// 创建时间：2017年06月11日
// 创建人员：Lemo
// 功能说明：firstPageGameDetail page
//################################
'use strict';

import React, {Component} from 'react';
import {
    View,
    ScrollView,
    StyleSheet,
    Text,
    Image,
    Dimensions,
    ActivityIndicator,
    TouchableOpacity,
    InteractionManager
} from 'react-native';

import {
    UIConstants,
    Colors,
    FontSizes,
    CommonData,
    CommonFunc
} from '../../common';

import Images from '../../images';
import * as ActionTypes from '../../actions/types';
import {getFundHistory} from '../../actions';

const WINDOW_WIDTH = Dimensions.get('window').width;
const WINDOW_HEIGHT = Dimensions.get('window').height;

class FirstPageGameDetail extends Component {
    constructor(props) {
        super(props);

        this.onBackPress = this.onBackPressFunc.bind(this);
        
    }

    componentWillReceiveProps(nextProps) {
        switch (nextProps.actionType) {
            
            default:
                break;
        }
    }

    onBackPressFunc() {
        const {navigatorRoot} = this.props;
        InteractionManager.runAfterInteractions(() => {
            navigatorRoot.pop();
        });
    }

    errorHandler(msg) {
        toastTip(msg, 'long');
    }

    render() {
        return (
            
            <View style={styles.container}>
                <View style={styles.headers}>
                    <TouchableOpacity style={styles.headerback} onPress={this.onBackPress}>
                        <Image source={Images.Back} style={styles.headerbackicon} resizeMode={Image.resizeMode.contain} />
                        <Text style={styles.headerbacktext}>{UIConstants.my.back}</Text>
                    </TouchableOpacity>
                    <Text style={styles.headertext} numberOfLines={1}>
                       {'游戏详情'}
                    </Text>
                    <TouchableOpacity style={styles.headerback} disabled={true}>
                        <Image source={Images.Back} style={[styles.headerbackicon, {opacity: 0}]} resizeMode={Image.resizeMode.contain} />
                        <Text style={[styles.headerbacktext,{opacity: 0}]}>{UIConstants.my.back}</Text>
                    </TouchableOpacity>
                </View>

                <ScrollView style={{flex:1,backgroundColor:'#FEFEFE'}}>
                <View style={{padding:15,flex:1}}>
                    <View>
                        <View style={{alignItems:'center'}}><Text style={{fontSize:16,fontWeight:'bold'}}>{'神秘海域4'}</Text></View>
                        <View style={{alignItems:'center'}}><Image source={Images.cover001} style={styles.coverimg} resizeMode={Image.resizeMode.contain} /></View>
                        <View style={{paddingLeft:50}}>
                            <Text style={{fontSize:13}}>{'主机　　'}{'PS4'}</Text>
                            <Text style={{fontSize:13}}>{'语言　　'}{'繁体中文'}</Text>
                            <Text style={{fontSize:13}}>{'版本　　'}{'港版'}</Text>
                        </View>
                    </View>

                    <View style={styles.block}>
                        <View style={styles.blocktitle}><Text style={styles.titletxt}>{'游戏简介'}</Text></View>
                        <View style={styles.blockContent}><Text style={{fontSize:13}}>{'　　游戏简介'}</Text></View>
                    </View>

                    <View>
                        <View style={styles.blocktitle}><Text style={styles.titletxt}>{'游戏详情'}</Text></View>
                        <View style={styles.blockContent}><Text style={{fontSize:13}}>{'　　游戏简介\n游戏简介\n游戏简介\n游戏简介\n游戏简介\n游戏简介游戏简介\n游戏简介游戏简介\n游戏简介'}</Text></View>
                    </View>
                </View>
                </ScrollView>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#F8F8F8',
    },
    headers: {
        height: 60,
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'center',
        borderBottomWidth: 0.5,
        borderBottomColor: Colors.gray,
        backgroundColor: Colors.appHeaderBackground,
    },
    headertext: {
        flex: 1,
        fontSize: FontSizes.soiHeader,
        color: Colors.appHeaderText,
        textAlign: 'center',
        alignSelf: 'center',
        marginBottom: -12,
    },
    headerback: {
        flexDirection: 'row',
        marginBottom: -12,
        alignItems: 'center',
        padding: 8,
    },
    headerbackicon: {
        width: 20,
        height: 20,
    },
    headerbacktext: {
        fontSize: 17,
        color: Colors.appHeaderText,
    },
    
    coverimg: {
        width: WINDOW_WIDTH - 220,
        height: WINDOW_WIDTH - 190,
    },
    block: {
        marginTop: 10,
    },
    blocktitle: {
        borderBottomWidth:0.6,
        borderBottomColor:Colors.mySplitter,
        padding:5,
        paddingBottom:0,
        paddingLeft:0,
    },
    titletxt: {
        paddingLeft:5,
        paddingBottom:3,
        width:80,
        borderBottomColor:'red',
        borderBottomWidth:1.5
    },
    blockContent: {
        padding: 5,
    }
});

export default FirstPageGameDetail;